/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _LINUX_SWAP_AHEAD_H
#define _LINUX_SWAP_AHEAD_H

#ifdef CONFIG_EULEROS_SWAP_AHEAD
#include <linux/jump_label.h>
int swap_ahead_node(int nid);

int get_swap_ahead_scan_len(void);
void swap_ahead_might_sleep(int nid);
bool mm_noevict_page(struct page *page);

struct kobject;
int swap_ahead_sysfs_init(struct kobject *swap_kobj);

extern bool swap_enable_inherit(void);
extern bool is_tmpfs_swapped(void);
extern int disable_swap_default;
extern void swap_ahead_fork_mm(struct mm_struct *mm);
extern void swap_ahead_init_mm(struct mm_struct *mm, unsigned long default_dump_filter);
extern struct static_key_false enable_swap_ever_used;
#ifdef CONFIG_SYSFS
extern struct kobj_attribute sysfs_tmpfs_swap_attr;
extern struct kobj_attribute sysfs_enable_inherit_attr;
#endif
extern const struct file_operations proc_enable_swap_operations;
#else
static inline int swap_ahead_sysfs_init(struct kobject *swap_kobj)
{
	return 0;
}

static inline bool mm_noevict_page(struct page *page)
{
	return false;
}

static inline void swap_ahead_fork_mm(struct mm_struct *mm)
{
}

static inline void swap_ahead_init_mm(struct mm_struct *mm, unsigned long default_dump_filter)
{
}
#endif

#endif
